﻿<%@ page language="java" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <link rel="stylesheet" type="text/css" href="/HR_SYSTEM/Styles/bootstrap.min.css" />
    <link rel="stylesheet" type="text/css" href="/HR_SYSTEM/Styles/admin-all.css" />
    <script type="text/javascript" src="/HR_SYSTEM/Scripts/jquery-1.7.2.js"></script>
    <script type="text/javascript" src="/HR_SYSTEM/Scripts/jquery-ui-1.8.22.custom.min.js"></script>
    <link rel="stylesheet" type="text/css" href="/HR_SYSTEM/Styles/ui-lightness/jquery-ui-1.8.22.custom.css" />
    <script type="text/javascript" src="/HR_SYSTEM/Scripts/tip.js"></script>
</head>
<body>
    <div></div>
    <div class="alert alert-info">当前位置<b class="tip"></b>管理界面<b class="tip"></b>教育管理</div>
    <table class="table table-striped table-bordered table-condensed">
        <tr>
            <td colspan="2">
            	<span><font color="blue"><strong>请您对于教育培训项目【${education.edu_name}】进行严格审批</strong></font></span>
            	<span><font color="red"><strong>${msg}</strong></font></span>
            </td>
        </tr>
    </table>
    <table class="table table-striped table-bordered table-condensed" id="list" align="center">
        <thead>
            <tr class="tr_detail">
                <td>教育培训项目编号 </td>
                <td>教育培训项目名称</td>
                <td>员工姓名</td>
                <td>员工性别</td>
                <td>员工年龄</td>
                <td>审核流程</td>
                <td>具体操作</td>
            </tr>
        </thead>
        <tbody>
        <c:forEach items="${pb.beanList}" var="user">
        	<tr class="even">
                <td><a>${education.edu_id}</a></td>
                <td>${education.edu_name}</td>
                <td>${user.username}</td>
                <td>${user.sex}</td>
                <td>${user.age}</td>
                <td>
                	<c:choose>
                		<c:when test="${user.state eq 1}">
                			<font color="bule">审核已经通过</font>
                		</c:when>
                		<c:otherwise>
                			<a class="btn btn-inverse" id="update" onclick="return confirm('您确定要通过该员工的审核工作？')" href="<c:url value='/EduServlet?method=UpdateUserEduRelationShip&edu_id=${education.edu_id}&user_id=${user.user_id}'/>">通过审核</a>
                			<input type="hidden" name="edu_id" value="${education.edu_id}" />
                			<input type="hidden" name="user_id" value="${user.user_id}"/>
                		</c:otherwise>
                	</c:choose>
                </td>
                <td>
                	<c:choose>
                		<c:when test="${user.state eq 1}">
                			<font color="bule">审核已经通过,不可取消资格</font>
                		</c:when>
                		<c:otherwise>
							<a class="btn btn-danger" href="<c:url value='/EduServlet?method=deleteUserEduRelationship&edu_id=${education.edu_id}&user_id=${user.user_id}' />" onclick="return confirm('您确定要取消该员工培训资格？')">取消资格</a>                			
                		</c:otherwise>
                	</c:choose>
            	</td>
            </tr>
        </c:forEach>
            
            <tr class="tr_pagenumber">
                <td colspan="100">当前第${pb.pageCurrent}页/共${pb.pageCount}页&nbsp;&nbsp;共${pb.rowCount}条记录
                	&nbsp;&nbsp;
                	<a class="badge badge-inverse" href="${pb.url}&PageCurrent=1">首页</a>&nbsp;
                	<c:choose>
						<c:when test="${pb.pageCurrent < pb.pageCount}">
						<a class="badge badge-inverse" href="${pb.url}&PageCurrent=${pb.pageCurrent+1}">下一页</a>
					</c:when>
					
					<c:when test="${pb.pageCurrent >= pb.pageCount}">
						<a class="badge badge-warning">没有下一页</a>&nbsp;
					</c:when>
					</c:choose>
					
					<%--计算标签的的列表的起始 --%>
					<c:choose>
						<%--如果总页数不足10，那么显示所有页面 --%>
						<c:when test="${pb.pageCount<=10}">
							<c:set var="begin" value="1"></c:set>
							<c:set var="end" value="${pb.pageCount}"></c:set>
						</c:when>
						<c:otherwise>
							<%--当总页数>10时候,通过公式计算出begin和end --%>
							<c:set var="begin" value="${pb.pageCurrent-5}"></c:set>
							<c:set var="end" value="${pb.pageCurrent+4}"></c:set>
							<%--头溢出 --%>
							<c:if test="${begin<1}">
								<c:set var="begin" value="1"></c:set>
								<c:set var="end" value="10"></c:set>
							</c:if>
							<%--尾溢出 --%>
							<c:if test="${end>pb.pageCount}">
								<c:set var="begin" value="${pb.pageCount-10+1}"></c:set>
								<c:set var="end" value="${pb.pageCount}"></c:set>
							</c:if>
						</c:otherwise>
					</c:choose> 
					<%--循环遍历页码列表 --%> 
					<c:forEach var="i" begin="${begin}" end="${end}">
					<c:choose>
						<c:when test="${i eq pb.pageCurrent}">
							<a class="badge badge-warning">${i}</a>&nbsp;
						</c:when>
						<c:otherwise>
							<a class="badge badge-inverse" href="${pb.url}&PageCurrent=${i}">${i}</a> &nbsp;
						</c:otherwise>
					</c:choose>
					</c:forEach> 
                    <c:choose>
						<c:when test="${pb.pageCurrent > 1}">
							<a class="badge badge-inverse" href="${pb.url}&PageCurrent=${pb.pageCurrent-1}">上一页</a>
						</c:when>
						<c:when test="${pb.pageCurrent <= 1}">
							<a class="badge badge-warning">没有上一页</a>&nbsp;
						</c:when>
					</c:choose>
                    <a class="badge badge-inverse" href="${pb.url}&PageCurrent=${pb.pageCount}">尾页</a>
                </td>
            </tr>
        </tbody>
    </table>
</body>
</html>
